package FIT::Fixture::t::Factory;

use FIT::Test 'FIT::Fixture::Factory';
use base 'FIT::Fixture::t::Base';

sub bad_make: Test {
    my $self = shift;
    my $table = $self->make_table('Non_Existent_Fixture_Name');
    eval { IUT->new->make_fixture($table) };
    like $@, qr/load package/;
}

sub good_make: Test {
    my $self = shift;
    my $table = $self->make_table('FIT.t.Mock');
    my $fixture = IUT->new->make_fixture($table);
    ok $fixture->isa('FIT::t::Fixture::Mock');
}

sub compute_package_name: Test {
    is
        FIT::Fixture::Factory::compute_package_name('Ab Cd'),
        'Ab::Fixture::Cd';
}

